﻿@model SellAndBuy.Web.ViewModels.AdDetailsViewModel

@{
    ViewBag.Title = "AdDetails";
}

<h2>AdDetails</h2>

<fieldset>
    <div class="display-label">Owner</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Owner)
    </div>

    <div class="display-label">Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Title)
    </div>

    <div class="display-label">Description</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Description)
    </div>

    <div class="display-label">Price</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Price)
    </div>

    <div class="display-label">CreationDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.CreationDate)
    </div>

    @foreach (var picItem in Model.Pictures)
    {
        <div class="Ad" style="float:left;width:160px;height:130px">
            <div class="frame">
                <img alt ='@picItem.Title' src='@Url.Action("showpic", "home", new { adID = @Model.ID, fileName = @picItem.FileName, maxWidth = 500, maxHeight = 500 })'/>
            </div>
        </div>
    }

</fieldset>
<p>
    @Html.ActionLink("Edit", "AdEdit", new { id = Model.ID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
